from common.base import open_browser
from page.commodity_browsing_page import GoodsList, home_page_url


class CommodityBrowsing(object):
    def __init__(self, driver):
        self.browsing = GoodsList(driver)
        self.browsing.open_url(home_page_url)

    def enter_into_phone(self):
        """进入到手机类中点击所有商品"""
        self.browsing.click_phone()
        self.browsing.click_goods_all()

    def enter_into_work(self):
        """进入到办公类中点击所有商品"""
        self.browsing.click_work()
        self.browsing.click_goods_all()

    def enter_into_house_appliances(self):
        """进入到家用电器类中点击所有商品"""
        self.browsing.click_house_appliances()
        self.browsing.click_goods_all()

    def enter_into_computer(self):
        """进入到电脑类中点击所有商品"""
        self.browsing.click_computer()
        self.browsing.click_goods_all()

    def enter_into_clothing(self):
        """进入到男装/女装类中点击所有商品"""
        self.browsing.click_clothing()
        self.browsing.click_goods_all()

    def enter_into_digital_fashion(self):
        """进入到数码时尚类中点击所有商品"""
        self.browsing.click_digital_fashion()
        self.browsing.click_goods_all()

    def enter_into_maternal(self):
        """进入到母婴/玩具类中点击所有商品"""
        self.browsing.click_maternal()
        self.browsing.click_goods_all()

    def enter_into_food_wine(self):
        """进入到食品/酒类中点击所有商品"""
        self.browsing.click_food_wine()
        self.browsing.click_goods_all()

    def enter_into_exercise_outdoors(self):
        """进入到运动/户外类中点击所有商品"""
        self.browsing.click_exercise_outdoors()
        self.browsing.click_goods_all()


if __name__ == '__main__':
    driver = open_browser()
    cb = CommodityBrowsing(driver)
    # cb.enter_into_phone()
    # cb.enter_into_clothing()
    cb.enter_into_computer()
